import levels


class Controller(object):
    
    def __init__(self, parent):
        self.parent = parent

    def process_event(self):
        self.parent.process_event(event)


class RootController(Controller):

    def __init__(self):
        pass

    def start_game(self, level=1):
        if level < 1:
            return
        while level <= levels.NUM_LEVELS:
            self.current_level = levels.load_level(level)
            success = self.current_level.run()
            if not success:
                break
            level += 1

        self.game_over(level > levels.NUM_LEVELS)

    def game_over(self, win):
        if win:
            print 'win!'
        else:
            print 'lose'

